import request from '@/utils/request'

/**
 * 请求首页数据--系统http请求
 * @param date
 * @returns
 */
export function fetchHomeList(date) {
  return request.get('/api/v2/feed', date)
}
/**
 * 请求首页数据-axios客户端请求
 * @param date
 * @returns
 */
export function fetchHomeListAxios(params) {
  return request.get('/api/v2/feed', params)
}

/**
 * 获取关注接口
 */
export function fetchFocusData(pageIndex = 0) {
  return request.get('/api/v4/tabs/follow', { start: pageIndex })
}

/**
 * 获取分类数据
 * @returns
 */
export function fetchCategories() {
  return request.get('/api/v4/categories')
}

/**
 * 获取专题接口
 */
export function fetchTopicData(start = 0) {
  return request.get('/api/v3/specialTopics', { start: start })
}

/**
 * 获取排行榜
 * @param rankType "weekly" "monthly" "historical"
 * @returns
 */
export function fetchRankList(rankType) {
  return request.get('/api/v4/rankList/videos', { strategy: rankType })
}

/**
 *获取主题详情接口
 * @param id
 */
export function fetchTopicDetailList(id) {
  return request.get('/api/v3/lightTopics/internal/' + id)
}

/**
 * 获取视频详情接口
 * @param id
 */
export function fetchRelationList(id) {
  return request.get('/api/v4/video/related', { id: id })
}

/**
 * 获取分类详情接口
 * @param id
 * @param start
 */
export function fetchCategoryDetailList(id, start) {
  return request.get('/api/v4/categories/videoList', {
    id: id,
    start: start,
    udid: CommonConstants.UUID,
    deviceModel: CommonConstants.DEVICE_NUM
  })
}

/**
 * 获取wanAndroid首页Banner数据，测试校验API data：T泛型数据
 * @returns
 */
export function fetchWanAndroidBanner() {
  return request.get('/androidApi/banner/json')
}
